package fr.cephb.operonj.core.db.key;

import java.io.Serializable;

public class BuildChrom
	implements Serializable
	{
	private static final long serialVersionUID = 1L;
	private int buildId;
	private int chromId;
	public BuildChrom(int buildId,int chromId)
		{
		if(buildId<1) throw new IllegalArgumentException("bad build "+buildId);
		if(chromId<1) throw new IllegalArgumentException("bad chrom "+chromId);
		this.buildId=buildId;
		this.chromId=chromId;
		}
	
	@SuppressWarnings("unused")
	private BuildChrom()
		{
		}
	
	public int getBuildId()
		{
		return buildId;
		}
	
	public int getChromId()
		{
		return chromId;
		}

	@Override
	public int hashCode()
		{
		final int prime = 31;
		int result = 1;
		result = prime * result + buildId;
		result = prime * result + chromId;
		return result;
		}

	@Override
	public boolean equals(Object obj)
		{
		if (this == obj) return true;
		if (obj == null) return false;
		if (!(obj.getClass()!= this.getClass())) return false;
		BuildChrom other = (BuildChrom) obj;
		if (buildId != other.buildId) return false;
		if (chromId != other.chromId) return false;
		return true;
		}
	
	@Override
	public String toString()
		{
		return "{build:"+getBuildId()+",chrom:"+chromId+"}";
		}
	
	}
